<!DOCTYPE html>
<html>
<head>
    <title>Array Type Example 16</title>
    <script type="text/javascript">
        function compare(value1, value2) {
            if (value1 < value2) {
                return 1;
            } else if (value1 > value2) {
                return -1;
            } else {
                return 0;
            }
        }
        
        var values = [0, 1, 5, 10, 15];
        values.sort(compare);
        alert(values);    //15,10,5,1,0

    </script>
</head>
<body>

</body>
</html>